'use strict'

const { db, getUsers } = require('../db_helper')

const SAVE_USER = 'insert into users (user, psw, name) values (?, ?, ?)'

const test = async () => {
  db.serialize(() => {
    db.run('update users set psw=$psw where user=$user', {
      $user: 'lianzt',
      $psw: '111111'
    }, (err, data) => {
      console.log('error: ', err);
      console.log('data: ', data);
    })
  })
}

const query = () => {
  db.serialize(() => {
    db.get('SELECT * FROM users where user=$user', {$user: 'lianzt'},  function(err, row) {
      console.log(row);
    });
  });

  db.close();
}

test();
// query();